<template>
  <div class="english">
      <h3>&#118;</h3>
    <Table :columns="column" border :data="data"></Table>
  </div>
</template>

<script>
import Words from "./words";
export default {
  name: "",
  data() {
    return {
      data: [],
      column: [
          {type:"index",width:90},
        { title: "Word", key: "word", width: 200 },
        { title: "Phonics", key: "phonics",width:200},
        { title: "Chinese", key: "chinese"},
        { title: "category", key: "category",width:200},
        { title: "Step", key: "step",width:100},
        // { title: "Chinese", key: "chinese"},
      ],
      status:["生词","陌生","熟悉","掌握"],      
    };
  },
  created() {
    let words=[];
    let reg=new RegExp('[a-z]+\.','i');
    let rows=Words.split(/\n/).map(u=>{
        let w=u.substr(0,u.indexOf('/')).trim()
        let p=u.substr(u.indexOf('/'),u.lastIndexOf('/')-u.indexOf('/')+1).trim()
        let c=u.substr(u.lastIndexOf('/')+1,u.length-u.indexOf('/'));
        let type=c.match(/[a-z]+\./ig)||[];      
        let word={
            word:w,
            phonics:p,
            chinese:c,
            step:0,
            category:type.join(" "),
            state:0,
            study:0,
            test:0,
            wrong:0
        };
        words.push(word);
    })
    this.data=words.slice(0,100);
  },
};
</script>

<style lang="less">
</style>